<?php
session_start();
session_destroy();
$subNav = array();

$arr = explode("/", $_SERVER['PHP_SELF']);

$domain = substr($_SERVER['PHP_SELF'], 0, strlen($arr[1]) + 1);

set_include_path("../");
include("inc/essentials.php");
include("model/questions.php");
include("model/bank.php");
include("model/feedback.php");
include("model/orders.php");
include("model/airport.php");
include("model/daily.php");
include("model/doitac.php");
?>
<script>
    $mainNav.set("home")
</script>
<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.23.custom.css" />
<link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" />
<script language="javascript" src="js/jquery-1.9.1.min.js"></script>
<script language="javascript" src="js/jquery-1.8.0.js"></script>
<script language="javascript" src="js/jquery.easing.1.3.js"></script>-->
<script language="javascript" src="js/jquery-ui-1.8.23.custom.min.js"></script>
<script language="javascript" src="js/dialog.js"></script>
<script language="javascript" src="js/SearchForm.js"></script>
<script language="javascript" src="js/jquery.autocomplete.js"></script>

<link rel="stylesheet" type="text/css" href="css/dialog.css" />
<div id="listCity" style="display: none;">
    <?php require_once 'tpl/sup/list_city.php'; ?>
</div>
<div id="bdwrapper">
    <div class="tvo_booking">
        <div class="tvo_left">
            <section class="tabs1">
                <input id="tab1-1" type="radio" name="radio-set" class="tab1-selector-1" checked="checked" />
                <label for="tab1-1" class="tab1-label-1">Đặt vé <br />máy bay</label>

                <input id="tab1-2" type="radio" name="radio-set" class="tab1-selector-2" />
                <label for="tab1-2" class="tab2-label-2">Đặt phòng <br />& Tour</label>

                <input id="tab1-3" type="radio" name="radio-set" class="tab1-selector-3" />
                <label for="tab1-3" class="tab3-label-3">Thuê xe</label>

                <div class="clear-shadow"></div>

                <div class="content2">
                    <div class="content-1">
                        <div class="tvo_content">
                            <form action="" method="post">
                                <div class="line6">
                                </div>                    	
                                <span class="fwb fl dsb w50">Điểm đi</span>
                                <span class="fwb fl dsb w50">Điểm đến</span><div class="clear"></div>
                                <input name="go" id="go" type="text" datetype="departure" class="departure startplace fl dsb b0 input1 mgb10" onclick="select()" />
                                <input name="to" id="to" type="text" datetype="arrival" class="arrival endplace fl dsb b0 input1 mgb10" onclick="select()" />

                                <span class="fwb fl dsb w50 mgb5">Ngày đi</span>
                                <span class="fwb fl dsb w50 mgb5">Ngày về</span>
                                <div class="clear"></div>
                                <div class="w50 fl">
                                    <select name="day_go" id="day_go" class="focus_input dateoption">
                                        <?php for ($i = 1; $i <= 31; $i++) : ?>
                                            <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                                        <?php endfor; ?>
                                    </select>
                                    <select name="month_go" id="month_go" class="focus_input monthoption">
                                        <?php for ($j = 1; $j <= 12; $j++) : ?>
                                            <option value="<?php echo $j; ?>">Tháng <?php echo $j; ?></option>
                                        <?php endfor; ?>
                                    </select>
                                </div>
                                <div class="w50 fl">
                                    <select name="day_back" id="day_back" class="focus_input dateoption">
                                        <option value="0"></option>
                                        <?php for ($i = 1; $i <= 31; $i++) : ?>
                                            <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                                        <?php endfor; ?>
                                    </select>
                                    <select name="month_back" id="month_back" class="focus_input monthoption">
                                        <option value="0"></option>
                                        <?php for ($j = 1; $j <= 12; $j++) : ?>
                                            <option value="<?php echo $j; ?>">Tháng <?php echo $j; ?></option>
                                        <?php endfor; ?>
                                    </select>
                                </div>
                                <div class="clear"></div>                        
                                <div class="line6"></div>
                                <div class="fl mgb5 box3">
                                    Số Lượng<br />Người lớn <span>(> 12 tuổi)</span>
                                    <select name="nguoilon" id="nguoilon" class="focus_input personoption">
                                        <?php for ($i = 1; $i <= 50; $i++) : ?>
                                            <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                                        <?php endfor; ?>
                                    </select>
                                </div>
                                <div class="fl mgb5 box3">
                                    Số Lượng<br />Trẻ em <span>(2 - 12 tuổi)</span>
                                    <select name="treem" id="treem" class="focus_input personoption">
                                        <option value="0"></option>
                                        <?php for ($i = 1; $i <= 5; $i++) : ?>
                                            <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                                        <?php endfor; ?>

                                    </select>
                                </div>
                                <div class="fl mgb5 box3">
                                    Số Lượng<br />Em bé <span>(< 2 tuổi)</span>
                                    <select name="embe" id="embe" class="focus_input personoption">
                                        <option value="0"></option>
                                        <?php for ($i = 1; $i <= 5; $i++) : ?>
                                            <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
                                        <?php endfor; ?>

                                    </select>
                                </div>
                                <div class="clear"></div>                        
                                <div class="line6"></div>

                                <div class="fl p5">
                                    <input type="button" name="ctl00$cphMain$UsrSearchFormMainV31$btnSearch" value="Tìm chuyến bay" id="btnSearch" class="search">
                                </div>
                                <div class="clear"></div>
                            </form>
                        </div>            	   
                    </div>
                    <div class="content-2">
                        3
                    </div>
                    <div class="content-3">
                        2
                    </div>
                    <div class="content-4">
                        1
                    </div>
                </div>
            </section>            </div>
        <!-- End left -->
        <div class="tvo_right">
            <?php require_once 'tpl/sup/right.php'; ?>
        </div>

        <div class="clear">
        </div>
    </div>
    <div class="clearAll"></div>
    <ul class="listservice">
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/dat-ve.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/thue-xe.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/datphong.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/dulich.jpg" width="178" height="132" /></a></li>
        <li><a <?php metroLink("search.php") ?>><img src="img/banner/dichvu.jpg" width="178" height="132" /></a></li>
    </ul>
    <div class="contentticket">
        <div class="colticket">
            <div class="faq">
                <div class="titleforcus"><img src="img/icons/hinhthucmuave.png" width="46" height="44" />Quý khách có thể mua vé máy bay bằng các hình thức</div>
                <div class="clear"></div>
                <div><h3>1</h3><span>Trực tiếp trên website, nhanh nhất - tiện nhất</span></div>
                <div><h3>2</h3><span>Qua chat<br />Book vé quốc tế:  Ms. Thúy  Mr. Long  Mr. Điệp<br />Book vé nội địa:  Ms. Mai  Ms. Chi Ms. Tú</span></div>
                <div><h3>3</h3><span>Gọi điện thoại cho skyexpress 04.3533.5558 - 08.3547.1122</span></div>
                <div><h3>4</h3><span>Đến trực tiếp văn phòng Sky express<br />Cơ sở 1: Q.Cầu Giấy Hà Nội<br />Cơ sở 2: <br />Cơ sở 3: </span></div>
            </div>
            <div class="map"><img src="demo/map.jpg" /></div>
        </div>
        <div class="colpaygate">
            <div class="faq">
                <div class="titleforcus">
                    <img src="img/icons/hinhthucmuave.png" width="46" height="44" />
                    <span class="name">Các hình thức thanh toán</span>
                    <div class="clear"></div>
                    <div>
                        <img src="http://www.abay.vn/images/NewAbayImg/abaylogo.png"/>
                        <span style="font-size: 11px; margin-top: 11px; margin-left: -11px">Trực tiếp trên website, nhanh nhất - tiện nhất</span>
                    </div>
                    <div>
                        <img src="http://www.abay.vn/images/NewAbayImg/abaylogo.png"/>
                        <span style="font-size: 11px; margin-top: 11px; margin-left: -11px">Trực tiếp trên website, nhanh nhất - tiện nhất</span>
                    </div>
                </div>

            </div>
            <ul class="listbank">
                <?php 
                $bank = Bank::findAll();
                foreach ($bank as $_bank){
                ?>
                <li><a href="/win-skyexpress/pages/bank_info.php?id=<?php echo $_bank["id"] ?>"><img src="<?php echo $_bank["images"] ?>" width="181" height="54"/></a></li>
                <?php } ?>
                <div class="clear"></div>
            </ul>
        </div>
        <div class="colad"><a href="/demo/dangky.php"><img src="img/banner/bannersky.jpg" width="178" height="549" /></a></div>
    </div>
    <div class="clear"></div>
    <div class="col3">
        <!--aboutus-->
        <div class="aboutus">
            <div class="title"><img src="img/icons/khachhang.png" /><span>Khách hàng nói về chúng tôi</span></div>
            <?php 
            $feedback = FeedBack::findLimit();
            foreach ($feedback as $_feedback) {
                $str = @mb_substr($_feedback["comments"], 0, 35,'UTF-8');
                $tv_title = strlen($_feedback["comments"]) > 35 ? @mb_substr($str, 0, strrpos($str, " "),'UTF-8')."..." : $_feedback["comments"]; 
                $phone = substr($_feedback["phone"], 0, 6);
            ?>
            <div class="comment">
                <div class="talkicon"><img src="img/icons/talk.png" width="35" height="30" /></div>
                <div class="talk"><span><?php echo $tv_title ?><span class="name"><?php echo $_feedback["name"] ?> - <?php echo $phone."XXX" ?></span></span></div>
                <div class="clear"></div>
            </div>
            <?php } ?>
            <div class="clear"></div>
            <a href="/phanhoi.php"><div class="chitiet"><img src="img/icons/chitiet.png" /><span>Chi tiết</span></div></a>
        </div>
        <!--ask-->
        <div class="ask">
            <div class="title"><img src="img/icons/cauhoi.png" /><span>Câu hỏi thường gặp</span></div>
            <div class="clear"></div>
            <ul>
                <?php
                $question = Questions::findAll();
                foreach ($question as $_question) {
                    ?>
                    <li><a href="/win-skyexpress/pages/cauhoi_detail.php?id=<?php echo $_question['id'] ?>"><?php echo $_question["title"] ?></a></li>
                <?php } ?>
            </ul>
            <a href="#"><div class="chitiet"><img src="img/icons/chitiet.png" /><span>Chi tiết</span></div></a>
        </div>
    </div>
</div>
<div class="clear"></div>
<div class="webfooter">
    <?php require_once 'tpl/sup/footer.php'; ?>
</div>
<script>
    $('#btnSearch').click(function() {
        $.ajax({
            // The link we are accessing.
            url: "<?php echo $domain ?>/ajax.php",
            // The type of request.
            type: "get",
            data: "act=search_list_air&go=" + $('#go').val() + "&to=" + $('#to').val() + "&day_go=" + $('#day_go').val() + "&day_back=" + $('#day_back').val() + "&month_go=" + $('#month_go').val() + "&month_back=" + $('#month_back').val() + "&nguoilon=" + $('#nguoilon').val() + "&treem=" + $('#treem').val() + "&embe=" + $('#embe').val(),
            // The type of data that is getting returned.
            dataType: "html",
            error: function() {
                // Load the content in to the page.
                $("#error").html("<label>Page Not Found!!</label>");
                $("#error").css({display: "block"});
            },
            success: function(strData) {
                // Load the content in to the page.
                window.location.href = '<?php echo $domain ?>/#!/url=search.php';
            }
        });
    });
</script>